
Partial Class VersionInfo
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        Me.LogoImage.ImageUrl = GetAppSetting("StateLogoURL")
        Me.ApplicationNameLabel.Text = GetAppSetting("ApplicationName")
        SetVersionInfo()
    End Sub

    Private Sub SetVersionInfo()

        Dim currAssembly As System.Reflection.Assembly = System.Reflection.Assembly.GetExecutingAssembly()
        Dim currFileInfo As New System.IO.FileInfo(currAssembly.Location)
        Dim versionDateString = currFileInfo.LastWriteTime.ToShortDateString()
        Me.VersionDateLabel.Text = versionDateString
    End Sub

    Public Function GetAppSetting(ByVal settingName As String) As String
        If Me.SettingsList(settingName) Is Nothing Then
            Return ""
        Else
            Return Me.SettingsList(settingName).ToString()
        End If

    End Function

    Private Sub SetSettingsList()
        Dim pageSettingsList As New Hashtable
        pageSettingsList.Add("ApplicationName", Application("AppName"))
        pageSettingsList.Add("StateDepartmentName", Application("StateDeptName"))
        pageSettingsList.Add("StateLogoURL", Application("CurrentLogo"))

        Me.SettingsList = pageSettingsList
    End Sub

    Private Property SettingsList() As Hashtable
        Get
            If ViewState("settingslist") Is Nothing Then
                SetSettingsList()
            End If
            Return ViewState("settingslist")
        End Get
        Set(ByVal value As Hashtable)
            ViewState("settingslist") = value
        End Set
    End Property
End Class
